package com.example.android;

import java.net.HttpURLConnection;
import java.net.URL;

public class DownPicture {
    public void DownLoad() throws Exception
    {
        //定义下载后的文件名和下载地址
        String fileName = "picture01.png";
        String Path = "http://192.168.1.30/xframe/images/icons/logo.png";
        URL url = new URL(Path);
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        //定义连接超时时间
        con.setConnectTimeout(5000);
        con.setRequestMethod("Get");

        int filelength = con.getContentLength();

    }
}
